
/*
===============================================================================
                    EntitySpaces Studio by EntitySpaces, LLC
             Persistence Layer and Business Objects for Microsoft .NET
             EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC
                          http://www.entityspaces.net
===============================================================================
EntitySpaces Version : 2012.1.0930.0
EntitySpaces Driver  : SQL
Date Generated       : 2016/7/28 0:24:06
===============================================================================
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using System.Data;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using EntitySpaces.Core;
using EntitySpaces.Interfaces;
using EntitySpaces.DynamicQuery;



namespace yncTech.BusinessObjects
{
	/// <summary>
	/// Encapsulates the 'V_BoxReceipts' view
	/// </summary>

    [DebuggerDisplay("Data = {Debug}")]
	[Serializable]
	[DataContract]
	[KnownType(typeof(VBoxReceipts))]	
	[XmlType("VBoxReceipts")]
	public partial class VBoxReceipts : esVBoxReceipts
	{	
		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden | DebuggerBrowsableState.Never)]
		protected override esEntityDebuggerView[] Debug
		{
			get { return base.Debug; }
		}

		override public esEntity CreateInstance()
		{
			return new VBoxReceipts();
		}
		
		#region Static Quick Access Methods
		
		#endregion

		
					
		
	
	}



    [DebuggerDisplay("Count = {Count}")]
	[Serializable]
	[CollectionDataContract]
	[XmlType("VBoxReceiptsCollection")]
	public partial class VBoxReceiptsCollection : esVBoxReceiptsCollection, IEnumerable<VBoxReceipts>
	{

		
		
		#region WCF Service Class
		
		[DataContract]
		[KnownType(typeof(VBoxReceipts))]
		public class VBoxReceiptsCollectionWCFPacket : esCollectionWCFPacket<VBoxReceiptsCollection>
		{
			public static implicit operator VBoxReceiptsCollection(VBoxReceiptsCollectionWCFPacket packet)
			{
				return packet.Collection;
			}

			public static implicit operator VBoxReceiptsCollectionWCFPacket(VBoxReceiptsCollection collection)
			{
				return new VBoxReceiptsCollectionWCFPacket() { Collection = collection };
			}
		}
		
		#endregion
		
				
	}



    [DebuggerDisplay("Query = {Parse()}")]
	[Serializable]	
	public partial class VBoxReceiptsQuery : esVBoxReceiptsQuery
	{
		public VBoxReceiptsQuery():this("VBoxReceiptsQuery")
		{
		}
		public VBoxReceiptsQuery(string joinAlias)
		{
			this.es.JoinAlias = joinAlias;
		}	

		override protected string GetQueryName()
		{
			return "VBoxReceiptsQuery";
		}
		
					
	
		#region Explicit Casts
		
		public static explicit operator string(VBoxReceiptsQuery query)
		{
			return VBoxReceiptsQuery.SerializeHelper.ToXml(query);
		}

		public static explicit operator VBoxReceiptsQuery(string query)
		{
			return (VBoxReceiptsQuery)VBoxReceiptsQuery.SerializeHelper.FromXml(query, typeof(VBoxReceiptsQuery));
		}
		
		#endregion		
	}

	[DataContract]
	[Serializable]
	abstract public partial class esVBoxReceipts : esEntity
	{
		public esVBoxReceipts()
		{

		}
		
		#region LoadByPrimaryKey
		
		#endregion
		
		#region Properties
		
		
		
		/// <summary>
		/// Maps to V_BoxReceipts.BoxID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? BoxID
		{
			get
			{
				return base.GetSystemDecimal(VBoxReceiptsMetadata.ColumnNames.BoxID);
			}
			
			set
			{
				if(base.SetSystemDecimal(VBoxReceiptsMetadata.ColumnNames.BoxID, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.BoxLocation
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? BoxLocation
		{
			get
			{
				return base.GetSystemDecimal(VBoxReceiptsMetadata.ColumnNames.BoxLocation);
			}
			
			set
			{
				if(base.SetSystemDecimal(VBoxReceiptsMetadata.ColumnNames.BoxLocation, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxLocation);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.BoxNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String BoxNo
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.BoxNo);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.BoxNo, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.DocumentType
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocumentType
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.DocumentType);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.DocumentType, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.DocumentType);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.FunctionDept
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String FunctionDept
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.FunctionDept);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.FunctionDept, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.FunctionDept);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.BoxYear
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? BoxYear
		{
			get
			{
				return base.GetSystemInt32(VBoxReceiptsMetadata.ColumnNames.BoxYear);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxReceiptsMetadata.ColumnNames.BoxYear, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxYear);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.BoxMonth
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? BoxMonth
		{
			get
			{
				return base.GetSystemInt32(VBoxReceiptsMetadata.ColumnNames.BoxMonth);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxReceiptsMetadata.ColumnNames.BoxMonth, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxMonth);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.BoxIndex
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? BoxIndex
		{
			get
			{
				return base.GetSystemInt32(VBoxReceiptsMetadata.ColumnNames.BoxIndex);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxReceiptsMetadata.ColumnNames.BoxIndex, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxIndex);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.StorageStatus
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String StorageStatus
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.StorageStatus);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.StorageStatus, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.StorageStatus);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.SupplierBoxNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String SupplierBoxNo
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.SupplierBoxNo);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.SupplierBoxNo, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.SupplierBoxNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.IsOpen_na
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Boolean? IsOpenNa
		{
			get
			{
				return base.GetSystemBoolean(VBoxReceiptsMetadata.ColumnNames.IsOpenNa);
			}
			
			set
			{
				if(base.SetSystemBoolean(VBoxReceiptsMetadata.ColumnNames.IsOpenNa, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.IsOpenNa);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.CreatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CreatedBy
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.CreatedBy);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.CreatedBy, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.CreatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.CreatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? CreatedDttm
		{
			get
			{
				return base.GetSystemDateTime(VBoxReceiptsMetadata.ColumnNames.CreatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(VBoxReceiptsMetadata.ColumnNames.CreatedDttm, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.CreatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.UpdatedBy
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String UpdatedBy
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.UpdatedBy);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.UpdatedBy, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.UpdatedBy);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.UpdatedDttm
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? UpdatedDttm
		{
			get
			{
				return base.GetSystemDateTime(VBoxReceiptsMetadata.ColumnNames.UpdatedDttm);
			}
			
			set
			{
				if(base.SetSystemDateTime(VBoxReceiptsMetadata.ColumnNames.UpdatedDttm, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.UpdatedDttm);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.VersionNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? VersionNo
		{
			get
			{
				return base.GetSystemInt32(VBoxReceiptsMetadata.ColumnNames.VersionNo);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxReceiptsMetadata.ColumnNames.VersionNo, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.VersionNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.CompanyCode
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CompanyCode
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.CompanyCode);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.CompanyCode, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.CompanyCode);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.ReceiptCount
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? ReceiptCount
		{
			get
			{
				return base.GetSystemInt32(VBoxReceiptsMetadata.ColumnNames.ReceiptCount);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxReceiptsMetadata.ColumnNames.ReceiptCount, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.ReceiptCount);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.LocationNmae
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String LocationNmae
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.LocationNmae);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.LocationNmae, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.LocationNmae);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.DocTypeName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocTypeName
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.DocTypeName);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.DocTypeName, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.DocTypeName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.DeptName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DeptName
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.DeptName);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.DeptName, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.DeptName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.StorageStatusName
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String StorageStatusName
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.StorageStatusName);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.StorageStatusName, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.StorageStatusName);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.CompanyInfo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String CompanyInfo
		{
			get
			{
				return base.GetSystemString(VBoxReceiptsMetadata.ColumnNames.CompanyInfo);
			}
			
			set
			{
				if(base.SetSystemString(VBoxReceiptsMetadata.ColumnNames.CompanyInfo, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.CompanyInfo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxReceipts.InTransfer
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? InTransfer
		{
			get
			{
				return base.GetSystemInt32(VBoxReceiptsMetadata.ColumnNames.InTransfer);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxReceiptsMetadata.ColumnNames.InTransfer, value))
				{
					OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.InTransfer);
				}
			}
		}		
		
		#endregion	

		#region .str() Properties
		
		public override void SetProperties(IDictionary values)
		{
			foreach (string propertyName in values.Keys)
			{
				this.SetProperty(propertyName, values[propertyName]);
			}
		}
		
		public override void SetProperty(string name, object value)
		{
			esColumnMetadata col = this.Meta.Columns.FindByPropertyName(name);
			if (col != null)
			{
				if(value == null || value is System.String)
				{				
					// Use the strongly typed property
					switch (name)
					{							
						case "BoxID": this.str().BoxID = (string)value; break;							
						case "BoxLocation": this.str().BoxLocation = (string)value; break;							
						case "BoxNo": this.str().BoxNo = (string)value; break;							
						case "DocumentType": this.str().DocumentType = (string)value; break;							
						case "FunctionDept": this.str().FunctionDept = (string)value; break;							
						case "BoxYear": this.str().BoxYear = (string)value; break;							
						case "BoxMonth": this.str().BoxMonth = (string)value; break;							
						case "BoxIndex": this.str().BoxIndex = (string)value; break;							
						case "StorageStatus": this.str().StorageStatus = (string)value; break;							
						case "SupplierBoxNo": this.str().SupplierBoxNo = (string)value; break;							
						case "IsOpenNa": this.str().IsOpenNa = (string)value; break;							
						case "CreatedBy": this.str().CreatedBy = (string)value; break;							
						case "CreatedDttm": this.str().CreatedDttm = (string)value; break;							
						case "UpdatedBy": this.str().UpdatedBy = (string)value; break;							
						case "UpdatedDttm": this.str().UpdatedDttm = (string)value; break;							
						case "VersionNo": this.str().VersionNo = (string)value; break;							
						case "CompanyCode": this.str().CompanyCode = (string)value; break;							
						case "ReceiptCount": this.str().ReceiptCount = (string)value; break;							
						case "LocationNmae": this.str().LocationNmae = (string)value; break;							
						case "DocTypeName": this.str().DocTypeName = (string)value; break;							
						case "DeptName": this.str().DeptName = (string)value; break;							
						case "StorageStatusName": this.str().StorageStatusName = (string)value; break;							
						case "CompanyInfo": this.str().CompanyInfo = (string)value; break;							
						case "InTransfer": this.str().InTransfer = (string)value; break;
					}
				}
				else
				{
					switch (name)
					{	
						case "BoxID":
						
							if (value == null || value is System.Decimal)
								this.BoxID = (System.Decimal?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxID);
							break;
						
						case "BoxLocation":
						
							if (value == null || value is System.Decimal)
								this.BoxLocation = (System.Decimal?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxLocation);
							break;
						
						case "BoxYear":
						
							if (value == null || value is System.Int32)
								this.BoxYear = (System.Int32?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxYear);
							break;
						
						case "BoxMonth":
						
							if (value == null || value is System.Int32)
								this.BoxMonth = (System.Int32?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxMonth);
							break;
						
						case "BoxIndex":
						
							if (value == null || value is System.Int32)
								this.BoxIndex = (System.Int32?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.BoxIndex);
							break;
						
						case "IsOpenNa":
						
							if (value == null || value is System.Boolean)
								this.IsOpenNa = (System.Boolean?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.IsOpenNa);
							break;
						
						case "CreatedDttm":
						
							if (value == null || value is System.DateTime)
								this.CreatedDttm = (System.DateTime?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.CreatedDttm);
							break;
						
						case "UpdatedDttm":
						
							if (value == null || value is System.DateTime)
								this.UpdatedDttm = (System.DateTime?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.UpdatedDttm);
							break;
						
						case "VersionNo":
						
							if (value == null || value is System.Int32)
								this.VersionNo = (System.Int32?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.VersionNo);
							break;
						
						case "ReceiptCount":
						
							if (value == null || value is System.Int32)
								this.ReceiptCount = (System.Int32?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.ReceiptCount);
							break;
						
						case "InTransfer":
						
							if (value == null || value is System.Int32)
								this.InTransfer = (System.Int32?)value;
								OnPropertyChanged(VBoxReceiptsMetadata.PropertyNames.InTransfer);
							break;
					

						default:
							break;
					}
				}
			}
            else if (this.ContainsColumn(name))
            {
                this.SetColumn(name, value);
            }
			else
			{
				throw new Exception("SetProperty Error: '" + name + "' not found");
			}
		}		

		public esStrings str()
		{
			if (esstrings == null)
			{
				esstrings = new esStrings(this);
			}
			return esstrings;
		}

		sealed public class esStrings
		{
			public esStrings(esVBoxReceipts entity)
			{
				this.entity = entity;
			}
			
	
			public System.String BoxID
			{
				get
				{
					System.Decimal? data = entity.BoxID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxID = null;
					else entity.BoxID = Convert.ToDecimal(value);
				}
			}
				
			public System.String BoxLocation
			{
				get
				{
					System.Decimal? data = entity.BoxLocation;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxLocation = null;
					else entity.BoxLocation = Convert.ToDecimal(value);
				}
			}
				
			public System.String BoxNo
			{
				get
				{
					System.String data = entity.BoxNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxNo = null;
					else entity.BoxNo = Convert.ToString(value);
				}
			}
				
			public System.String DocumentType
			{
				get
				{
					System.String data = entity.DocumentType;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocumentType = null;
					else entity.DocumentType = Convert.ToString(value);
				}
			}
				
			public System.String FunctionDept
			{
				get
				{
					System.String data = entity.FunctionDept;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.FunctionDept = null;
					else entity.FunctionDept = Convert.ToString(value);
				}
			}
				
			public System.String BoxYear
			{
				get
				{
					System.Int32? data = entity.BoxYear;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxYear = null;
					else entity.BoxYear = Convert.ToInt32(value);
				}
			}
				
			public System.String BoxMonth
			{
				get
				{
					System.Int32? data = entity.BoxMonth;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxMonth = null;
					else entity.BoxMonth = Convert.ToInt32(value);
				}
			}
				
			public System.String BoxIndex
			{
				get
				{
					System.Int32? data = entity.BoxIndex;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxIndex = null;
					else entity.BoxIndex = Convert.ToInt32(value);
				}
			}
				
			public System.String StorageStatus
			{
				get
				{
					System.String data = entity.StorageStatus;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.StorageStatus = null;
					else entity.StorageStatus = Convert.ToString(value);
				}
			}
				
			public System.String SupplierBoxNo
			{
				get
				{
					System.String data = entity.SupplierBoxNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.SupplierBoxNo = null;
					else entity.SupplierBoxNo = Convert.ToString(value);
				}
			}
				
			public System.String IsOpenNa
			{
				get
				{
					System.Boolean? data = entity.IsOpenNa;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.IsOpenNa = null;
					else entity.IsOpenNa = Convert.ToBoolean(value);
				}
			}
				
			public System.String CreatedBy
			{
				get
				{
					System.String data = entity.CreatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedBy = null;
					else entity.CreatedBy = Convert.ToString(value);
				}
			}
				
			public System.String CreatedDttm
			{
				get
				{
					System.DateTime? data = entity.CreatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CreatedDttm = null;
					else entity.CreatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String UpdatedBy
			{
				get
				{
					System.String data = entity.UpdatedBy;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedBy = null;
					else entity.UpdatedBy = Convert.ToString(value);
				}
			}
				
			public System.String UpdatedDttm
			{
				get
				{
					System.DateTime? data = entity.UpdatedDttm;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.UpdatedDttm = null;
					else entity.UpdatedDttm = Convert.ToDateTime(value);
				}
			}
				
			public System.String VersionNo
			{
				get
				{
					System.Int32? data = entity.VersionNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.VersionNo = null;
					else entity.VersionNo = Convert.ToInt32(value);
				}
			}
				
			public System.String CompanyCode
			{
				get
				{
					System.String data = entity.CompanyCode;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CompanyCode = null;
					else entity.CompanyCode = Convert.ToString(value);
				}
			}
				
			public System.String ReceiptCount
			{
				get
				{
					System.Int32? data = entity.ReceiptCount;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.ReceiptCount = null;
					else entity.ReceiptCount = Convert.ToInt32(value);
				}
			}
				
			public System.String LocationNmae
			{
				get
				{
					System.String data = entity.LocationNmae;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.LocationNmae = null;
					else entity.LocationNmae = Convert.ToString(value);
				}
			}
				
			public System.String DocTypeName
			{
				get
				{
					System.String data = entity.DocTypeName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocTypeName = null;
					else entity.DocTypeName = Convert.ToString(value);
				}
			}
				
			public System.String DeptName
			{
				get
				{
					System.String data = entity.DeptName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DeptName = null;
					else entity.DeptName = Convert.ToString(value);
				}
			}
				
			public System.String StorageStatusName
			{
				get
				{
					System.String data = entity.StorageStatusName;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.StorageStatusName = null;
					else entity.StorageStatusName = Convert.ToString(value);
				}
			}
				
			public System.String CompanyInfo
			{
				get
				{
					System.String data = entity.CompanyInfo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.CompanyInfo = null;
					else entity.CompanyInfo = Convert.ToString(value);
				}
			}
				
			public System.String InTransfer
			{
				get
				{
					System.Int32? data = entity.InTransfer;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.InTransfer = null;
					else entity.InTransfer = Convert.ToInt32(value);
				}
			}
			

			private esVBoxReceipts entity;
		}
		
		[NonSerialized]
		private esStrings esstrings;		
		
		#endregion
		
		#region Housekeeping methods

		override protected IMetadata Meta
		{
			get
			{
				return VBoxReceiptsMetadata.Meta();
			}
		}

		#endregion		
		
		#region Query Logic

		public VBoxReceiptsQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new VBoxReceiptsQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(VBoxReceiptsQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return this.Query.Load();
		}
		
		protected void InitQuery(VBoxReceiptsQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntity)this).Connection;
			}			
		}

		#endregion
		
        [IgnoreDataMember]
		private VBoxReceiptsQuery query;		
	}



	[Serializable]
	abstract public partial class esVBoxReceiptsCollection : esEntityCollection<VBoxReceipts>
	{
		#region Housekeeping methods
		override protected IMetadata Meta
		{
			get
			{
				return VBoxReceiptsMetadata.Meta();
			}
		}

		protected override string GetCollectionName()
		{
			return "VBoxReceiptsCollection";
		}

		#endregion		
		
		#region Query Logic

	#if (!WindowsCE)
		[BrowsableAttribute(false)]
	#endif
		public VBoxReceiptsQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new VBoxReceiptsQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(VBoxReceiptsQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return Query.Load();
		}

		override protected esDynamicQuery GetDynamicQuery()
		{
			if (this.query == null)
			{
				this.query = new VBoxReceiptsQuery();
				this.InitQuery(query);
			}
			return this.query;
		}

		protected void InitQuery(VBoxReceiptsQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntityCollection)this).Connection;
			}			
		}

		protected override void HookupQuery(esDynamicQuery query)
		{
			this.InitQuery((VBoxReceiptsQuery)query);
		}

		#endregion
		
		private VBoxReceiptsQuery query;
	}



	[Serializable]
	abstract public partial class esVBoxReceiptsQuery : esDynamicQuery
	{
		override protected IMetadata Meta
		{
			get
			{
				return VBoxReceiptsMetadata.Meta();
			}
		}	
		
		#region QueryItemFromName
		
        protected override esQueryItem QueryItemFromName(string name)
        {
            switch (name)
            {
				case "BoxID": return this.BoxID;
				case "BoxLocation": return this.BoxLocation;
				case "BoxNo": return this.BoxNo;
				case "DocumentType": return this.DocumentType;
				case "FunctionDept": return this.FunctionDept;
				case "BoxYear": return this.BoxYear;
				case "BoxMonth": return this.BoxMonth;
				case "BoxIndex": return this.BoxIndex;
				case "StorageStatus": return this.StorageStatus;
				case "SupplierBoxNo": return this.SupplierBoxNo;
				case "IsOpenNa": return this.IsOpenNa;
				case "CreatedBy": return this.CreatedBy;
				case "CreatedDttm": return this.CreatedDttm;
				case "UpdatedBy": return this.UpdatedBy;
				case "UpdatedDttm": return this.UpdatedDttm;
				case "VersionNo": return this.VersionNo;
				case "CompanyCode": return this.CompanyCode;
				case "ReceiptCount": return this.ReceiptCount;
				case "LocationNmae": return this.LocationNmae;
				case "DocTypeName": return this.DocTypeName;
				case "DeptName": return this.DeptName;
				case "StorageStatusName": return this.StorageStatusName;
				case "CompanyInfo": return this.CompanyInfo;
				case "InTransfer": return this.InTransfer;

                default: return null;
            }
        }		
		
		#endregion
		
		#region esQueryItems

		public esQueryItem BoxID
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.BoxID, esSystemType.Decimal); }
		} 
		
		public esQueryItem BoxLocation
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.BoxLocation, esSystemType.Decimal); }
		} 
		
		public esQueryItem BoxNo
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.BoxNo, esSystemType.String); }
		} 
		
		public esQueryItem DocumentType
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.DocumentType, esSystemType.String); }
		} 
		
		public esQueryItem FunctionDept
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.FunctionDept, esSystemType.String); }
		} 
		
		public esQueryItem BoxYear
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.BoxYear, esSystemType.Int32); }
		} 
		
		public esQueryItem BoxMonth
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.BoxMonth, esSystemType.Int32); }
		} 
		
		public esQueryItem BoxIndex
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.BoxIndex, esSystemType.Int32); }
		} 
		
		public esQueryItem StorageStatus
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.StorageStatus, esSystemType.String); }
		} 
		
		public esQueryItem SupplierBoxNo
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.SupplierBoxNo, esSystemType.String); }
		} 
		
		public esQueryItem IsOpenNa
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.IsOpenNa, esSystemType.Boolean); }
		} 
		
		public esQueryItem CreatedBy
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.CreatedBy, esSystemType.String); }
		} 
		
		public esQueryItem CreatedDttm
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.CreatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem UpdatedBy
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.UpdatedBy, esSystemType.String); }
		} 
		
		public esQueryItem UpdatedDttm
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.UpdatedDttm, esSystemType.DateTime); }
		} 
		
		public esQueryItem VersionNo
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.VersionNo, esSystemType.Int32); }
		} 
		
		public esQueryItem CompanyCode
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.CompanyCode, esSystemType.String); }
		} 
		
		public esQueryItem ReceiptCount
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.ReceiptCount, esSystemType.Int32); }
		} 
		
		public esQueryItem LocationNmae
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.LocationNmae, esSystemType.String); }
		} 
		
		public esQueryItem DocTypeName
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.DocTypeName, esSystemType.String); }
		} 
		
		public esQueryItem DeptName
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.DeptName, esSystemType.String); }
		} 
		
		public esQueryItem StorageStatusName
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.StorageStatusName, esSystemType.String); }
		} 
		
		public esQueryItem CompanyInfo
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.CompanyInfo, esSystemType.String); }
		} 
		
		public esQueryItem InTransfer
		{
			get { return new esQueryItem(this, VBoxReceiptsMetadata.ColumnNames.InTransfer, esSystemType.Int32); }
		} 
		
		#endregion
		
	}



	[Serializable]
	public partial class VBoxReceiptsMetadata : esMetadata, IMetadata
	{
		#region Protected Constructor
		protected VBoxReceiptsMetadata()
		{
			m_columns = new esColumnMetadataCollection();
			esColumnMetadata c;

			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.BoxID, 0, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.BoxID;
			c.NumericPrecision = 18;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.BoxLocation, 1, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.BoxLocation;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.BoxNo, 2, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.BoxNo;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.DocumentType, 3, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.DocumentType;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.FunctionDept, 4, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.FunctionDept;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.BoxYear, 5, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.BoxYear;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.BoxMonth, 6, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.BoxMonth;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.BoxIndex, 7, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.BoxIndex;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.StorageStatus, 8, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.StorageStatus;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.SupplierBoxNo, 9, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.SupplierBoxNo;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.IsOpenNa, 10, typeof(System.Boolean), esSystemType.Boolean);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.IsOpenNa;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.CreatedBy, 11, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.CreatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.CreatedDttm, 12, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.CreatedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.UpdatedBy, 13, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.UpdatedBy;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.UpdatedDttm, 14, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.UpdatedDttm;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.VersionNo, 15, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.VersionNo;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.CompanyCode, 16, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.CompanyCode;
			c.CharacterMaxLength = 30;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.ReceiptCount, 17, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.ReceiptCount;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.LocationNmae, 18, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.LocationNmae;
			c.CharacterMaxLength = 100;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.DocTypeName, 19, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.DocTypeName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.DeptName, 20, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.DeptName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.StorageStatusName, 21, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.StorageStatusName;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.CompanyInfo, 22, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.CompanyInfo;
			c.CharacterMaxLength = 72;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxReceiptsMetadata.ColumnNames.InTransfer, 23, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxReceiptsMetadata.PropertyNames.InTransfer;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
		}
		#endregion	
	
		static public VBoxReceiptsMetadata Meta()
		{
			return meta;
		}	
		
		public Guid DataID
		{
			get { return base.m_dataID; }
		}	
		
		public bool MultiProviderMode
		{
			get { return false; }
		}		

		public esColumnMetadataCollection Columns
		{
			get	{ return base.m_columns; }
		}
		
		#region ColumnNames
		public class ColumnNames
		{ 
			 public const string BoxID = "BoxID";
			 public const string BoxLocation = "BoxLocation";
			 public const string BoxNo = "BoxNo";
			 public const string DocumentType = "DocumentType";
			 public const string FunctionDept = "FunctionDept";
			 public const string BoxYear = "BoxYear";
			 public const string BoxMonth = "BoxMonth";
			 public const string BoxIndex = "BoxIndex";
			 public const string StorageStatus = "StorageStatus";
			 public const string SupplierBoxNo = "SupplierBoxNo";
			 public const string IsOpenNa = "IsOpen_na";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string VersionNo = "VersionNo";
			 public const string CompanyCode = "CompanyCode";
			 public const string ReceiptCount = "ReceiptCount";
			 public const string LocationNmae = "LocationNmae";
			 public const string DocTypeName = "DocTypeName";
			 public const string DeptName = "DeptName";
			 public const string StorageStatusName = "StorageStatusName";
			 public const string CompanyInfo = "CompanyInfo";
			 public const string InTransfer = "InTransfer";
		}
		#endregion	
		
		#region PropertyNames
		public class PropertyNames
		{ 
			 public const string BoxID = "BoxID";
			 public const string BoxLocation = "BoxLocation";
			 public const string BoxNo = "BoxNo";
			 public const string DocumentType = "DocumentType";
			 public const string FunctionDept = "FunctionDept";
			 public const string BoxYear = "BoxYear";
			 public const string BoxMonth = "BoxMonth";
			 public const string BoxIndex = "BoxIndex";
			 public const string StorageStatus = "StorageStatus";
			 public const string SupplierBoxNo = "SupplierBoxNo";
			 public const string IsOpenNa = "IsOpenNa";
			 public const string CreatedBy = "CreatedBy";
			 public const string CreatedDttm = "CreatedDttm";
			 public const string UpdatedBy = "UpdatedBy";
			 public const string UpdatedDttm = "UpdatedDttm";
			 public const string VersionNo = "VersionNo";
			 public const string CompanyCode = "CompanyCode";
			 public const string ReceiptCount = "ReceiptCount";
			 public const string LocationNmae = "LocationNmae";
			 public const string DocTypeName = "DocTypeName";
			 public const string DeptName = "DeptName";
			 public const string StorageStatusName = "StorageStatusName";
			 public const string CompanyInfo = "CompanyInfo";
			 public const string InTransfer = "InTransfer";
		}
		#endregion	

		public esProviderSpecificMetadata GetProviderMetadata(string mapName)
		{
			MapToMeta mapMethod = mapDelegates[mapName];

			if (mapMethod != null)
				return mapMethod(mapName);
			else
				return null;
		}
		
		#region MAP esDefault
		
		static private int RegisterDelegateesDefault()
		{
			// This is only executed once per the life of the application
			lock (typeof(VBoxReceiptsMetadata))
			{
				if(VBoxReceiptsMetadata.mapDelegates == null)
				{
					VBoxReceiptsMetadata.mapDelegates = new Dictionary<string,MapToMeta>();
				}
				
				if (VBoxReceiptsMetadata.meta == null)
				{
					VBoxReceiptsMetadata.meta = new VBoxReceiptsMetadata();
				}
				
				MapToMeta mapMethod = new MapToMeta(meta.esDefault);
				mapDelegates.Add("esDefault", mapMethod);
				mapMethod("esDefault");
			}
			return 0;
		}			

		private esProviderSpecificMetadata esDefault(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();			


				meta.AddTypeMap("BoxID", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("BoxLocation", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("BoxNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("DocumentType", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("FunctionDept", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("BoxYear", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("BoxMonth", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("BoxIndex", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("StorageStatus", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("SupplierBoxNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("IsOpenNa", new esTypeMap("bit", "System.Boolean"));
				meta.AddTypeMap("CreatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("CreatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("UpdatedBy", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("UpdatedDttm", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("VersionNo", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("CompanyCode", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ReceiptCount", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("LocationNmae", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("DocTypeName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("DeptName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("StorageStatusName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("CompanyInfo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("InTransfer", new esTypeMap("int", "System.Int32"));			
				
				
				
				meta.Source = "V_BoxReceipts";
				meta.Destination = "V_BoxReceipts";
				
				meta.spInsert = "proc_V_BoxReceiptsInsert";				
				meta.spUpdate = "proc_V_BoxReceiptsUpdate";		
				meta.spDelete = "proc_V_BoxReceiptsDelete";
				meta.spLoadAll = "proc_V_BoxReceiptsLoadAll";
				meta.spLoadByPrimaryKey = "proc_V_BoxReceiptsLoadByPrimaryKey";
				
				this.m_providerMetadataMaps["esDefault"] = meta;
			}
			
			return this.m_providerMetadataMaps["esDefault"];
		}

		#endregion

		static private VBoxReceiptsMetadata meta;
		static protected Dictionary<string, MapToMeta> mapDelegates;
		static private int _esDefault = RegisterDelegateesDefault();
	}
}
